export const table_config = () => {
    const config = {
        pageSize: 10,
        pageNum: 1,
        total: 1000,
        rowKey: "postId", //如果需要树型数据填写这个，否则为空
        defaultColumnWidth: 260,//默认的列宽

        //UI
        defaultExpandAll: false, //是否默认展开所有行
        pagingShow: true,//本页1-2
        totalShow: true,//共10条数据
        paginationShow: true,//分页

        selectionChange:true, //是否支持多选
        searchList: [
            {placeholder: '请输入岗位编码', label: '岗位编码', key: 'postCode', type: 'text'},
            {placeholder: '请输入岗位名称', label: '岗位名称', key: 'postName', type: 'text'},
            {
                placeholder: '岗位状态',
                label: '状态',
                key: 'status',
                type: 'select',
                source: "dict", //source: dict字典查询/select 数据来源方向
                dict: "sys_normal_disable",
            },
        ],
        buttonList: [
            {name: '刷新数据', type: 'primary', plain: true, emitLabel: 'refresh'},
            {name: '展开折叠', type: 'info', emitLabel: 'expand'},
            {name: '新增岗位', type: 'primary', emitLabel: 'add', power:"system:post:add"},
            {name: '删除岗位', type: 'danger', emitLabel: 'delAll', power:"system:post:remove"},
        ],
        tableList: [
            {label: '岗位名称', key: 'postName', link: true},
            {label: '岗位编码', key: 'postCode'},
            {label: '岗位排序', key: 'postSort'},
            {label: '状态', key: 'status', dicKey: "sys_normal_disable"},
            {label: '创建时间', key: 'createTime'}
        ],
        tableButton: {
            name: '操作',
            list: [
                {name: '修改', type: 'success', emitLabel: 'edit', childrenDisplay: false, power:"system:post:edit"},
                // {name: '新增', type: 'primary', emitLabel: 'addChildren', childrenDisplay: false},
                {name: '删除', type: 'danger', emitLabel: 'delete', childrenDisplay: true, power:"system:post:remove"}
            ]
        }
    }
    return config
}